<html>
<head>
<style type="text/css">
td.prewrap, td.code {
  white-space: pre-wrap;
}

td.code {
  font-family: Andale Mono, monospace;
  font-size: 9pt;
}
</style>
</head>
<body>
<h3>{{ catalog_item.name }}-{{ catalog_item.version }}</h3>
<div class='item_detail'>
<table class='table table-striped table-condensed'>

<!-- most important keys -->
<tr><th scope="row">name</th><td>{{ catalog_item.name }}</td></tr>
<tr><th scope="row">version</th><td>{{ catalog_item.version }}</td></tr>
<tr><th scope="row">display_name</th><td>{{ catalog_item.display_name }}</td></tr>
<tr><th scope="row">description</th><td class="prewrap">{{ catalog_item.description }}</td></tr>
<tr><th scope="row">catalogs</th>
<td>
	{% for item in catalog_item.catalogs %}
		{{ item }}
		{% if not forloop.last %}<br />{% endif %}
	{% endfor %}
</td></tr>
<tr><th>installer_item</th><td>{{ catalog_item.installer_item_location }}</td></tr>

<!-- additional keys -->
{% for key, value in catalog_item.items %}
	{% if key not in "name version display_name description catalogs installer_item_location receipts installs payloads items_to_copy requires update_for blocking_applications" %}
		<tr><th scope="row">{{ key }}</th>
		{% if value.items %}
			<td>{% include "catalogs/generic_dict.html" with generic_dict=value only %}</td>
		{% else %}{% if "_script" in key %}
      <td class="code">{{ value }}</td>
    {% else %}
			<td>{{ value }}</td>
		{% endif %}{% endif %}
		</tr>
	{% endif %}
{% endfor %}

<!--lists_of_strings: blocking_applications, requires, update_for-->
{% if catalog_item.blocking_applications %}
	<tr><th scope="row">blocking_applications</th>
	<td>
		{% for item in catalog_item.blocking_applications %}
			{{ item }}
			{% if not forloop.last %}<br />{% endif %}
		{% endfor %}
	</td></tr>
{% endif %}
{% if catalog_item.requires %}
	<tr><th scope="row">requires</th>
	<td>
		{% for item in catalog_item.requires %}
			{{ item }}
			{% if not forloop.last %}<br />{% endif %}
		{% endfor %}
	</td></tr>
{% endif %}
{% if catalog_item.update_for %}
	<tr><th scope="row">update_for</th>
	<td>
		{% for item in catalog_item.update_for %}
			{{ item }}
			{% if not forloop.last %}<br />{% endif %}
		{% endfor %}
	</td></tr>
{% endif %}

<!-- lists_of_dicts: items_to_copy, installs, payloads and receipts if they exist; all have sub-tables -->
{% if catalog_item.items_to_copy %}
	<tr><th scope="row">items_to_copy</th>
	<td>{% include "catalogs/dict_list.html" with dict_list=catalog_item.items_to_copy only %}</td></tr>
{% endif %}
{% if catalog_item.installs %}
	<tr><th scope="row">installs</th>
	<td>{% include "catalogs/dict_list.html" with dict_list=catalog_item.installs only %}</td></tr>
{% endif %}
{% if catalog_item.payloads %}
	<tr><th scope="row">payloads</th>
	<td>{% include "catalogs/dict_list.html" with dict_list=catalog_item.payloads only %}</td></tr>
{% endif %}
{% if catalog_item.receipts %}
	<tr><th scope="row">receipts</th>
	<td>{% include "catalogs/dict_list.html" with dict_list=catalog_item.receipts only %}</td></tr>
{% endif %}

</table>
</div>
</body>
</html>
